import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },


                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },


                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },

                {
                    path: '/userInfo',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/UserInfo.vue'),
                    meta: { title: '个人信息' }
                },
                {
                    path: '/storeInfo',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/StoreInfo.vue'),
                    meta: { title: '店铺信息' }
                },
                {
                    path: '/foodCategory',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/FoodCategory.vue'),
                    meta: { title: '菜品分类管理' }
                },
                {
                    path: '/foodInfo',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/FoodInfo.vue'),
                    meta: { title: '菜品管理' }
                },
                {
                    path: '/orderInfo',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/OrderInfo.vue'),
                    meta: { title: '订单管理' }
                },
                {
                    path: '/dayOrderStatistics',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/DayOrderStatistics.vue'),
                    meta: { title: '店铺日销量' }
                },
                {
                    path: '/foodStatistics',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/FoodStatistics.vue'),
                    meta: { title: '菜品总销量' }
                },
                {
                    path: '/dayAmountStatistics',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/DayAmountStatistics.vue'),
                    meta: { title: '店铺日销售额' }
                },
                {
                    path: 'allStoreAmount',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/AllStoreAmount.vue'),
                    meta: { title: '所有店铺总销售额' }
                },
                {
                    path: 'announcement',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/Announcement.vue'),
                    meta: { title: '公告管理' }
                },
                {
                    path: 'userManage',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/UserManage.vue'),
                    meta: { title: '账号管理' }
                },
                // {
                //     path: 'roleAudit',
                //     component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/RoleAudit.vue'),
                //     meta: { title: '用户身份审核' }
                // },
                {
                    path: 'annComment',
                    component: () => import(/* webpackChunkName: "userInfo" */ '../components/page/AnnComment.vue'),
                    meta: { title: '公告留言' }
                }

            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        },

    ]
});
